package com.alibaba.ribbonresttemplate;

import com.alibaba.cloud.nacos.ribbon.NacosRule;
import com.netflix.loadbalancer.IRule;
import com.netflix.loadbalancer.RandomRule;
import com.netflix.loadbalancer.RoundRobinRule;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author YL
 * @date 13:55 2021/10/13
 */
@Configuration
public class RibbonConfig {

    @Bean
    public IRule iRule(){
        //NacosRule() nacos集群同地区优先获取
        return new RoundRobinRule();
    }
}
